<template>
  <div class="buttons-wrapper">
    <div class="button" v-for="(item) of items" v-if="item.bool"  :key="item.path" @click="item.action()">
      <img :src=item.img>
      <span>{{item.name}}</span>
    </div>
  </div>
</template>

<script>

import router from "@/router";

export default {
  name: 'BottomButtons',
  props: {
    items: {
      type: Array,
      default: () => ([
        {
          name: '上一页',
          img: require('@media/common/icon-left-arrow@2x.png'),
          bool:true,
          action: ()=>{
            if (router.currentRoute.name == "expomodule") {
              router.replace({name: 'firstExpomodule',query:{uid:JSON.parse(localStorage.getItem('query')).faUid}})
              return
            }
            if (router.currentRoute.name == "firstExpomodule") {
              router.replace({name: 'exhibition'})
              return
            }
            if (router.currentRoute.name == "exhibition") {
              router.replace({name: 'home'})
              return
            }
            router.back()
          },
        },
        {
          name: '首 页',
          img: require('@media/common/icon-home@2x.png'),
          bool:true,
          action: ()=>{ router.push({name: 'home'}) },
        },
      ])
    }
  },
  data () {
    return {

    };
  },
  methods: {
  },
  computed: {
  },
  components: {
  },
  created () {
  },
  watch: {
  }
}
</script>

<style scoped lang="scss">
@import "@/style/scss/component/buttonsBar.scss"
</style>

